local lunduan = fk.CreateSkill{
  name = "wk_heg__lunduan",
}

Fk:loadTranslationTable{
  ["wk_heg__lunduan"] = "论断",
  [":wk_heg__lunduan"] = "与你势力相同的角色于其回合内使用【杀】结算后，若此牌未造成伤害，你可令其获得一张<a href= ':Heg__policy'>“战策”</a>并选择一项：1.结束此回合；2.本回合使用【杀】次数上限+1且手牌上限-1。",
  ["wk_heg__lunduan_endturn"] = "结束此回合",
  ["wk_heg__lunduan_slash_more"] = "本回合使用【杀】次数上限+1",

  ["$wk_heg__lunduan1"] = "阁下若纳此谋，则大业可成也！",
  ["$wk_heg__lunduan2"] = "形势如此，将军可按计行事。",
}

local H = require "packages.ol_hegemony.util"
local HG = require "packages.new_heg_diy_my.util"

lunduan:addEffect(fk.CardUseFinished, {
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(lunduan.name) and data.card.trueName == "slash" and player.room.current == target
     and H.compareKingdomWith(player, target) and not data.damageDealt
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    HG.GetPolicy(room, target, 1, lunduan.name)
    local choices = {"wk_heg__lunduan_endturn", "wk_heg__lunduan_slash_more"}
    local choice = room:askToChoice(target, {choices = choices, skill_name = lunduan.name})
    if choice == "wk_heg__lunduan_endturn" then
      room:endTurn()
    else
      room:addPlayerMark(target, MarkEnum.SlashResidue.."-turn", 1)
      room:addPlayerMark(target, MarkEnum.MinusMaxCardsInTurn, 1)
    end
  end,
})

return lunduan
